package pattern.state.model;

public class ThirdGear extends Gear {

	public ThirdGear(Car car) {
		this.car = car;
	}
	
	@Override
	public void accelerate() throws Exception {
		car.setText("Faster? switch to 4 gear..");
		car.setState(car.getFourthGear());
		
	}

	@Override
	public void slowDown() throws Exception {
		car.setText("Slower? switch to 2 gear..");
		car.setState(car.getSecondGear());
		
	}

	@Override
	public void goBack() throws Exception {
		throw new IllegalStateException("Want to break the gearbox !?");
		
	}

	@Override
	public void stop() throws Exception {
		car.setText("Stop --- Neutral");
		car.setState(car.getNeutral());
		
	}
}
